//
//  MainChangeRegionCell.m
//  GSBlockChain
//
//  Created by guoshikeji_a on 2018/12/19.
//  Copyright © 2018 guoshikeji. All rights reserved.
//

#import "MainChangeRegionCell.h"



@interface MainChangeRegionCell ()

@property (nonatomic, strong) QMUILabel *regionLabel;

@end

@implementation MainChangeRegionCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.regionLabel = [QMUILabel new];
        self.regionLabel.textColor = [UIColor qmui_colorWithHexString:@"#333333"];
        self.regionLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightMedium];
        [self.contentView addSubview:self.regionLabel];
        [self.regionLabel mas_makeConstraints:^(MASConstraintMaker *make) {
            make.edges.mas_equalTo(self.contentView).insets(UIEdgeInsetsMake(0, 20, 0, 20));
        }];
        //
        [self addSubview:self.separatorLine];
        [self.separatorLine mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(self).offset(15.0);
            make.right.mas_equalTo(self).offset(-15.0);
            make.height.mas_equalTo(1.0);
            make.bottom.mas_equalTo(self);
        }];
    }
    return self;
}


- (void)setRegin:(BCHomeDateRegion *)region currentRegionId:(NSString *)currentRegionId {
    //
    self.regionLabel.text = region.name;
    //
    if ([currentRegionId isEqualToString:region.reg_id]) {
        self.accessoryType = UITableViewCellAccessoryCheckmark;
    }else {
        self.accessoryType = UITableViewCellAccessoryNone;
    }
}


@end
